/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class NotificationSyncRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"NotificationSyncRequest\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"topicListHash\",\"type\":\"int\"},{\"name\":\"topicStates\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"TopicState\",\"fields\":[{\"name\":\"topicId\",\"type\":\"long\"},{\"name\":\"seqNumber\",\"type\":\"int\"}],\"direction\":\"out\"}},\"null\"]},{\"name\":\"acceptedUnicastNotifications\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},\"null\"]},{\"name\":\"subscriptionCommands\",\"type\":[{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"SubscriptionCommand\",\"fields\":[{\"name\":\"topicId\",\"type\":\"long\"},{\"name\":\"command\",\"type\":{\"type\":\"enum\",\"name\":\"SubscriptionCommandType\",\"symbols\":[\"ADD\",\"REMOVE\"]}}],\"direction\":\"out\"}},\"null\"]}],\"direction\":\"out\"}");
private int topicListHash;
private java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> topicStates;
private java.util.List<java.lang.String> acceptedUnicastNotifications;
private java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> subscriptionCommands;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use {@link \#newBuilder()}.
*/
public NotificationSyncRequest() {
}
/**
* All-args constructor.
*/
public NotificationSyncRequest(java.lang.Integer topicListHash, java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> topicStates, java.util.List<java.lang.String> acceptedUnicastNotifications, java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> subscriptionCommands) {
this.topicListHash = topicListHash;
this.topicStates = topicStates;
this.acceptedUnicastNotifications = acceptedUnicastNotifications;
this.subscriptionCommands = subscriptionCommands;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new NotificationSyncRequest RecordBuilder
*/
public static org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder();
}
/**
* Creates a new NotificationSyncRequest RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder(other);
}
/**
* Creates a new NotificationSyncRequest RecordBuilder by copying an existing
* NotificationSyncRequest instance
*/
public static org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest other) {
return new org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder(other);
}
public org.apache.avro.Schema getSchema() {
return SCHEMA$;
}
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0:
return topicListHash;
case 1:
return topicStates;
case 2:
return acceptedUnicastNotifications;
case 3:
return subscriptionCommands;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0:
topicListHash = (java.lang.Integer) value$;
break;
case 1:
topicStates = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState>) value$;
break;
case 2:
acceptedUnicastNotifications = (java.util.List<java.lang.String>) value$;
break;
case 3:
subscriptionCommands = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'topicListHash' field.
*/
public java.lang.Integer getTopicListHash() {
return topicListHash;
}
/**
* Sets the value of the 'topicListHash' field.
*
* @param value the value to set.
*/
public void setTopicListHash(java.lang.Integer value) {
this.topicListHash = value;
}
/**
* Gets the value of the 'topicStates' field.
*/
public java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> getTopicStates() {
return topicStates;
}
/**
* Sets the value of the 'topicStates' field.
*
* @param value the value to set.
*/
public void setTopicStates(java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> value) {
this.topicStates = value;
}
/**
* Gets the value of the 'acceptedUnicastNotifications' field.
*/
public java.util.List<java.lang.String> getAcceptedUnicastNotifications() {
return acceptedUnicastNotifications;
}
/**
* Sets the value of the 'acceptedUnicastNotifications' field.
*
* @param value the value to set.
*/
public void setAcceptedUnicastNotifications(java.util.List<java.lang.String> value) {
this.acceptedUnicastNotifications = value;
}
/**
* Gets the value of the 'subscriptionCommands' field.
*/
public java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> getSubscriptionCommands() {
return subscriptionCommands;
}
/**
* Sets the value of the 'subscriptionCommands' field.
*
* @param value the value to set.
*/
public void setSubscriptionCommands(java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> value) {
this.subscriptionCommands = value;
}
/**
* RecordBuilder for NotificationSyncRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<NotificationSyncRequest>
implements org.apache.avro.data.RecordBuilder<NotificationSyncRequest> {
private int topicListHash;
private java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> topicStates;
private java.util.List<java.lang.String> acceptedUnicastNotifications;
private java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> subscriptionCommands;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.topicListHash)) {
this.topicListHash = data().deepCopy(fields()[0].schema(), other.topicListHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.topicStates)) {
this.topicStates = data().deepCopy(fields()[1].schema(), other.topicStates);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.acceptedUnicastNotifications)) {
this.acceptedUnicastNotifications = data().deepCopy(fields()[2].schema(), other.acceptedUnicastNotifications);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.subscriptionCommands)) {
this.subscriptionCommands = data().deepCopy(fields()[3].schema(), other.subscriptionCommands);
fieldSetFlags()[3] = true;
}
}
/**
* Creates a Builder by copying an existing NotificationSyncRequest instance
*/
private Builder(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest other) {
super(org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.SCHEMA$);
if (isValidValue(fields()[0], other.topicListHash)) {
this.topicListHash = data().deepCopy(fields()[0].schema(), other.topicListHash);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.topicStates)) {
this.topicStates = data().deepCopy(fields()[1].schema(), other.topicStates);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.acceptedUnicastNotifications)) {
this.acceptedUnicastNotifications = data().deepCopy(fields()[2].schema(), other.acceptedUnicastNotifications);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.subscriptionCommands)) {
this.subscriptionCommands = data().deepCopy(fields()[3].schema(), other.subscriptionCommands);
fieldSetFlags()[3] = true;
}
}
/**
* Gets the value of the 'topicListHash' field
*/
public java.lang.Integer getTopicListHash() {
return topicListHash;
}
/**
* Sets the value of the 'topicListHash' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setTopicListHash(int value) {
validate(fields()[0], value);
this.topicListHash = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'topicListHash' field has been set
*/
public boolean hasTopicListHash() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'topicListHash' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearTopicListHash() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'topicStates' field
*/
public java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> getTopicStates() {
return topicStates;
}
/**
* Sets the value of the 'topicStates' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setTopicStates(java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState> value) {
validate(fields()[1], value);
this.topicStates = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'topicStates' field has been set
*/
public boolean hasTopicStates() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'topicStates' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearTopicStates() {
topicStates = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'acceptedUnicastNotifications' field
*/
public java.util.List<java.lang.String> getAcceptedUnicastNotifications() {
return acceptedUnicastNotifications;
}
/**
* Sets the value of the 'acceptedUnicastNotifications' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setAcceptedUnicastNotifications(java.util.List<java.lang.String> value) {
validate(fields()[2], value);
this.acceptedUnicastNotifications = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'acceptedUnicastNotifications' field has been set
*/
public boolean hasAcceptedUnicastNotifications() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'acceptedUnicastNotifications' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearAcceptedUnicastNotifications() {
acceptedUnicastNotifications = null;
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'subscriptionCommands' field
*/
public java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> getSubscriptionCommands() {
return subscriptionCommands;
}
/**
* Sets the value of the 'subscriptionCommands' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder setSubscriptionCommands(java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand> value) {
validate(fields()[3], value);
this.subscriptionCommands = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'subscriptionCommands' field has been set
*/
public boolean hasSubscriptionCommands() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'subscriptionCommands' field
*/
public org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest.Builder clearSubscriptionCommands() {
subscriptionCommands = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
public NotificationSyncRequest build() {
try {
NotificationSyncRequest record = new NotificationSyncRequest();
record.topicListHash = fieldSetFlags()[0] ? this.topicListHash : (java.lang.Integer) defaultValue(fields()[0]);
record.topicStates = fieldSetFlags()[1] ? this.topicStates : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState>) defaultValue(fields()[1]);
record.acceptedUnicastNotifications = fieldSetFlags()[2] ? this.acceptedUnicastNotifications : (java.util.List<java.lang.String>) defaultValue(fields()[2]);
record.subscriptionCommands = fieldSetFlags()[3] ? this.subscriptionCommands : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand>) defaultValue(fields()[3]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}